<template>
    <div id="temp">
        <!--1.首页-->
        <mt-header fixed title="党建工作动态"></mt-header>
        <div class="tem">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell mui-media" v-for="(item, index) in list">
                    <router-link v-bind="{to:'/dynamicNews/newsInfo/'+item.id}">
                        <div class="mui-media-body">
                            <!--{{item.title}}-->
                          党建工作动态 2018第5期
                            <div class="ft">
                                <span class="nes" v-if="index<2">最新</span>
                                <span>{{item.add_time | datefmt('YYYY-MM-DD HH:mm:ss')}}</span>
                            </div>
                        </div>
                    </router-link>
                </li>
            </ul>
        </div>
    </div>
</template>
<script>
    //     按需导入访问错误
    import {Toast} from 'mint-ui';
    import kit from '../../kits/apikit.js'

    export default {
        data() {
            return {
                list: []
            }
        },
        created() {
            this.getactitylist();
        },
        methods: {
            getactitylist() {
                var url = kit.apikit + 'type=getnewslist';
                this.$http.get(url).then(function (res) {
                    var body = res.body;
                    if (body.status != 0) {
                        Toast(body.messge);
                        return;
                    }
                    this.list = body.message;
                });
            }
        }
    }
</script>
<style scoped>
    .mint-header {
        height: 45px;
        background-color: #4284D8;
        font-size: .35rem;
    }
    .tem{
        margin-top: 45px;
    }
    /*2.图片大小*/
    .mui-table-view img {
        height: 80px;
        width: 80px;

    }
    .ft {
        margin-top: 1.5em;
        font-size: 10px;
        color: #AEAEAE;

    }
    .ft .nes{
        line-height: .28rem;
        padding: .05rem .08rem;
        background-color:#EC542E ;
        color: #ffffff;
        border-radius: .05rem;
    }
</style>
